package com.cn.activitiNSV.configuration.httpclient;

import org.apache.http.client.config.RequestConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import javax.annotation.Resource;

/**
 * @Author: Eric
 **/
@Configuration
public class CustomRequestConfig {

    @Resource
    private Environment environment;

    @Bean
    public RequestConfig requestConfig() {
        return RequestConfig.custom()
                .setConnectionRequestTimeout(5000)
                .setConnectTimeout(5000)
                .setSocketTimeout(60000)
                .build();
    }
}
